Text and Number Identifiers
Returns the absolute value of number N.
$abs(5) returns 5 $abs(-1) returns 1
Returns A binary and B.
Returns the ascii number of the character C.
$asc(A) returns 65 $asc(*) returns 42
$base(N,inbase,outbase,zeropad,precision) Converts number N from inbase to outbase. The last two parameters are optional.
$base(15,10,16) returns F $base(1.5,10,16) returns 1.8 $base(2,10,16,3) returns 002
Returns the A value with the Nth bit turned on.
Returns the A value with the Nth bit turned off.
Returns comma formatted file-size.
Properties: suf
The bkmgt options return the result as bytes, kilobytes, etc.
The .suf property appends the b, k, M, G, T suffixes to the result.
The 3 option returns a result in 3 digit format.
The d option retains decimal point values.
Returns the result of the specified operations. This identifiers allows you to perform multiple operations easily. For example:
$calc(3.14159 * (2 ^ %x % 3) - ($ticks / (10000 + 1)))
Returns N rounded to the next highest integer.
Returns the character with ascii number N.
$chr(65) returns A $chr(42) returns *
$decompress(file|&bvar) Compresses the specified file or binary variable. The result is raw compressed data.
Where b indicates a binary variable in the first parameter, and lN sets a compression level of 1 to 6 (default is 6). Returns 1 for success, 0 for failure.
Return the cosine and arccosine of N.
Properties: deg
$count(string,substring,substring2,...,substringN) Returns the number of times substring occurs in string.
$count(hello,el) returns 1 $count(hello,l) returns 2
Note: $countcs() is the case-sensitive version.
$encode(%var | &binvar, mubt, N) $decode(%var | &binvar, mubt, N) Encode or decode text in %vars or &binvars using Uuencode or Mime.
The second parameter consists of switches, where m = mime, u = uucode (default), b = &binvar, and t = text (default).
The final encoded line is made up of 60-character chunks. You can specify N if you want mIRC to return the Nth chunk. N = 0 returns the total number of chunks in the line.
If encoding/decoding a &binvar, the identifiers return the actual number of characters written to the &binvar. Note that encoding uses 33% more storage space.
The last two parameters are optional, default to uuencode, and N = 1.
Returns N rounded to the next lowest integer.
Returns the integer part of a floating point number with no rounding.
$int(3.14159) returns 3
Returns 1 if the Nth bit in number A is turned on.
Returns $true if text is all lower case.
Returns $true if text is all upper case.
Returns the N left characters of text.
$left(goodbye,4) returns good
If N is a negative value, it returns all but N characters.
Returns the length of text.
$len(#mIRC) returns 5
Returns the natural logarithm of N.
Converts an IP address into a long value and vice-versa.
$longip(158.152.50.239) returns 2660774639 $longip(2660774639) returns 158.152.50.239
Returns text in lowercase.
$lower(HELLO) returns hello
Returns N characters starting at position S in text.
$mid(othello,3,4) returns hell
If N is zero, it returns the number of characters from S to the end of the line.
You may also use negative numbers for S or N.
Returns the binary not value of A.
Returns A binary or B.
Appends st, nd, rd, th as appropriate to the number N.
Returns a number indicating the position of the Nth occurrence of string in text.
$pos(hello there,e,1) returns 2 $pos(hello there,e,2) returns 9 $pos(hello there,a,1) returns $null
If N is zero, it returns the number of times string appears in text.
Note: You can use $poscs() for a case-sensitive version.
$noqt(text) Add/remove outer enclosing quotes around text.
This works in two ways. If you supply it with numbers for v1 and v2, it returns a random number between v1 and v2. If you supply it with letters, it returns a random letter between letters v1 and v2.
$rand(a,z) returns a letter in the range a,b,c,...,z $rand(A,Z) returns a letter in the range A,B,C,...,Z $rand(0,N) returns a number in the range 0,1,2,...,N
Removes any occurrence of substring in string.
$remove(abcdefg,cd) returns abefg
You can also specify multiple remove parameters:
$remove(abcdefg,a,c,e,g) returns bdf
Note: You can use $removecs() for a case-sensitive version.
$replace(string,substring,newstring,...) Replaces any occurrence of substring in string with newstring.
$replace(abcdefg,cd,xyz) returns abxyzefg
You can also specify multiple replace parameters:
$replace(abcdefg,a,A,b,B,c,C,d,D) returns ABCDefg
Note: You can use $replacecs() for a case-sensitive version.
$replacex(string,substring,newstring,...) Replaces any occurrence of substring in string with newstring except for replacements that have already been made.
Note: You can use $replacexcs() for a case-sensitive version.
Returns the N right characters of text.
$right(othello,5) returns hello
If N is a negative value, it returns all but N characters.
Returns the specified floating point number rounded to the Dth decimal digit.
$round(3.14159,2) returns 3.14
The D parameter is optional.
Return the sine and arcsine of N.
Properties: deg
Returns the square root of N.
Returns text repeated N times.
$str(ho,3) returns hohoho
Returns text with all bold, underline, reverse, and color control codes stripped out.
The burcmo parameter is optional, if used, it strips only the specified types of characters.
The m applies the strip settings in the Messages dialog, and the o applies the "only if..." settings in the messages dialog.
Returns the number of control codes that were stripped from an incoming message, if any. This can be used in any script event that triggers when a message is received from a user.
Return the tangent and arctangent of N.
Properties: deg
Returns text in uppercase.
$upper(hello) returns HELLO
$wrap(text, font, size, width, [word,] N) Returns Nth line in text wrapped to the specified width in pixels.
If the optional word parameter is 1, text is wrapped at whole words (which is the default).
You can specify 0 for N to return the total number of wrapped lines.
Returns A binary xor B. |